package cn.zjyj.module.zjyj.dal.mysql.devicegroup;

import cn.zjyj.framework.common.common.pojo.PageResult;
import cn.zjyj.framework.datasource.mybatis.core.query.LambdaQueryWrapperX;
import cn.zjyj.framework.datasource.mybatis.core.mapper.BaseMapperX;
import cn.zjyj.module.zjyj.dal.dataobject.devicegroup.DeviceGroupDO;
import org.apache.ibatis.annotations.Mapper;
import cn.zjyj.module.zjyj.controller.admin.devicegroup.vo.*;

/**
 * 设备分组 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface DeviceGroupMapper extends BaseMapperX<DeviceGroupDO> {

    default PageResult<DeviceGroupDO> selectPage(DeviceGroupPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DeviceGroupDO>()
                .betweenIfPresent(DeviceGroupDO::getCreateTime, reqVO.getCreateTime())
                .likeIfPresent(DeviceGroupDO::getName, reqVO.getName())
                .eqIfPresent(DeviceGroupDO::getSort, reqVO.getSort())
                .orderByDesc(DeviceGroupDO::getId));
    }

}